package com.gexiaobao.pigeon.app.model.bean

import java.io.Serializable

/**
 *  分页数据的基类
 */
data class ApiPagerListResponse<T>(

    var list: T,
    var passResultBody: T,
    var curPage: Int,
    var offset: Int,
    var over: Boolean,
    var pageCount: Int,
    var size: Int,
    var total: Int,
    var shopName: String = "",
    var startTime: String = "",
    var countDown: Long = 0,
    var state: Int = 0,
    var payState: Boolean = true,

) : Serializable {
    /**
     * 数据是否为空
     */
    fun isEmpty() = list == null || (list as List<*>).isEmpty()

    /**
     * 数据是否为空
     */
    fun isEmptyBody() = passResultBody == null || (passResultBody as List<*>).isEmpty()

    /**
     * 是否为刷新
     */
    fun isRefresh() = offset == 0

    /**
     * 是否还有更多数据
     */
    fun hasMore() = !over
}